from View.guiroot import *
import tkinter as tk

from tkModelFrame.dataview import DataFrameViewr

#对比数据页面
matchMenu = NewWorkingSpace(RF, "开始处理EXCEL", "对比数据")
tk.Label(matchMenu.ws, text="").pack()


tk.Label(matchMenu.ws, text="请选择做对比的表格", font=20).pack(pady=5)
excel2MatchChooser = FileChooser(matchMenu.ws, multiple=False, filetypes=[("Excel文件", ".xlsx .xls"), ])
excel2MatchChooser.pack(pady=10)


matchPreviewWindow = SubWindow(matchMenu.ws, size="600x400", title="缺失数据预览")
matchPreviewButton = tk.Button(matchMenu.ws, text="预览对比结果", width=30, command=matchPreviewWindow.open)
matchSaveButton = tk.Button(matchMenu.ws, text="对比表格数据并保存", width=30, command=lambda :print("对比表格数据并保存"))

matchIndexBox = tk.Frame(matchMenu.ws)
tk.Label(matchIndexBox, text="请选择索引列: ").grid(row=0, column=0)
matchIndexChooser = DynamicDropMenu(matchIndexBox, width=25, buttonstate=False)
matchIndexChooser.grid(row=0, column=1)

tk.Label(matchMenu.ws, text='------------------------------------------------------------------').pack()

matchIndexBox.pack(pady=10, fill='x')
matchPreviewButton.pack(pady=10)
matchSaveButton.pack(pady=5)

##对比结果预览
matchPreviewTable: DataFrameViewr = DataFrameViewr(matchPreviewWindow.frame, name="缺失数据", df=excelMatchResult.df)
matchPreviewTable.pack()
